package com.niiwoo.civet.user.service.duboo;

import com.alibaba.dubbo.config.annotation.Service;
import com.niiwoo.civet.user.dto.request.UserAuthorizationInfoDTO;
import com.niiwoo.civet.user.dto.response.UserAuthorizationInfoResponseDTO;
import com.niiwoo.civet.user.service.UserAuthorizationInfoDubboService;
import com.niiwoo.civet.user.service.local.UserAuthorizationInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Set;

/**
 * @Author: wuke
 * @Description:
 * @Date: Created in 16:00 2017/11/8
 */
@Slf4j
@Service(version = "1.0.0")
public class UserAuthorizationInfoDubboServiceImpl implements UserAuthorizationInfoDubboService {

    @Autowired
    private UserAuthorizationInfoService userAuthorizationInfoService;


    /**
     * 获取用户授权相关信息
     *
     * @param userId
     * @return
     */
    @Override
    public UserAuthorizationInfoResponseDTO getUserAuthorizationInfo(String userId) {
        return userAuthorizationInfoService.getUserAuthorizationInfo(userId);
    }

    @Override
    public List<UserAuthorizationInfoResponseDTO> queryUserAuthorizationInfoListByUserIdSet(Set<String> userIdSet){
    	return userAuthorizationInfoService.queryUserAuthorizationInfoListByUserIdSet(userIdSet);
    }

    /**
     * 法大大授权
     *
     * @param userId
     * @return
     */
    @Override
    public String fadadaAuth(String userId) {
        return userAuthorizationInfoService.fadadaAuth(userId);
    }

    /**
     * 企业法大大授权
     *
     * @param orgId
     * @return
     */
    @Override
    public String fadadaEnterAuth(String orgId) {
        return userAuthorizationInfoService.fadadaEnterAuth(orgId);
    }

    /**
     * 卡牛法大大授权
     * @param userId
     * @return
     */
    @Override
    public String cardniuFadadaAuth(String userId) {
        return userAuthorizationInfoService.cardniuFadadaAuth(userId);
    }

    /**
     * 查询用户授权信息
     * @param userId
     * @return
     */
    @Override
    public UserAuthorizationInfoDTO selectByUserId(String userId){
        return userAuthorizationInfoService.selectByUserId(userId);
    }
}
